/*
 * frmWin.java
 *
 * Created on __DATE__, __TIME__
 */

package com.attilax.xml;

import java.awt.Color;

import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JLayeredPane;
import javax.swing.JPanel;

/**
 *
 * @author  __USER__
 */
public class frmWin extends javax.swing.JFrame {

	/** Creates new form frmWin */
	public frmWin() {
		this.setUndecorated(true);
		initComponents();

		((JPanel) this.getContentPane()).setOpaque(false);

		ImageIcon img = new ImageIcon("C:\\bg.jpg");// 背景图片
		JLabel lblPicture = new JLabel(img);
		lblPicture.setBounds(0, 0, img.getIconWidth(), img.getIconHeight());
		JLayeredPane layeredPane = this.getLayeredPane();
		layeredPane.setBorder(BorderFactory.createLineBorder(Color.blue, 3));
		layeredPane.add(lblPicture, new Integer(Integer.MIN_VALUE));
		//	this.setOpacity(0.7f);
		jButton2.setOpaque(false);
		jButton2.setContentAreaFilled(false);
		jButton2.setBorderPainted(false);

	//	jLayeredPane2.setBounds(this.getBounds());//(.getWidth(),this.getHeight());
	//	jLayeredPane2.setBorder(BorderFactory.createLineBorder(Color.red, 3));
		//      this.getContentPane().add(lblPicture);

	}

	/** This method is called from within the constructor to
	 * initialize the form.
	 * WARNING: Do NOT modify this code. The content of this method is
	 * always regenerated by the Form Editor.
	 */
	//GEN-BEGIN:initComponents
	// <editor-fold defaultstate="collapsed" desc="Generated Code">
	private void initComponents() {

		jButton1 = new javax.swing.JButton();
		jLayeredPane1 = new javax.swing.JLayeredPane();
		jLabel2 = new javax.swing.JLabel();
		jButton2 = new javax.swing.JButton();
		jLabel1 = new javax.swing.JLabel();

		setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

		jButton1.setText("jButton1");

		jLabel2.setIcon(new javax.swing.ImageIcon("C:\\close.png")); // NOI18N
		jLabel2.setText("jLabel2");
		jLabel2.addMouseListener(new java.awt.event.MouseAdapter() {
			public void mouseClicked(java.awt.event.MouseEvent evt) {
				jLabel2MouseClicked(evt);
			}
		});
		jLabel2.setBounds(100, 0, 150, 30);
		jLayeredPane1.add(jLabel2, javax.swing.JLayeredPane.DEFAULT_LAYER);
		jLabel2.getAccessibleContext().setAccessibleName("imgLab");

		jButton2.setIcon(new javax.swing.ImageIcon("C:\\close.png")); // NOI18N
		jButton2.setBorderPainted(false);
		jButton2.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				jButton2ActionPerformed(evt);
			}
		});
		jButton2.setBounds(370, 0, 280, 40);
		jLayeredPane1.add(jButton2, javax.swing.JLayeredPane.DEFAULT_LAYER);

		jLabel1.setIcon(new javax.swing.ImageIcon("C:\\title.jpg")); // NOI18N
		jLabel1.setText("jLabel1");
		jLabel1.setPreferredSize(new java.awt.Dimension(700, 37));
		jLabel1.setBounds(0, 0, 940, -1);
		jLayeredPane1.add(jLabel1, javax.swing.JLayeredPane.DEFAULT_LAYER);

		javax.swing.GroupLayout layout = new javax.swing.GroupLayout(
				getContentPane());
		getContentPane().setLayout(layout);
		layout.setHorizontalGroup(layout
				.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
				.addGroup(
						layout.createSequentialGroup()
								.addGroup(
										layout.createParallelGroup(
												javax.swing.GroupLayout.Alignment.LEADING)
												.addGroup(
														layout.createSequentialGroup()
																.addGap(35, 35,
																		35)
																.addComponent(
																		jButton1))
												.addGroup(
														layout.createSequentialGroup()
																.addGap(21, 21,
																		21)
																.addComponent(
																		jLayeredPane1,
																		javax.swing.GroupLayout.PREFERRED_SIZE,
																		696,
																		javax.swing.GroupLayout.PREFERRED_SIZE)))
								.addContainerGap(42, Short.MAX_VALUE)));
		layout.setVerticalGroup(layout
				.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
				.addGroup(
						javax.swing.GroupLayout.Alignment.TRAILING,
						layout.createSequentialGroup()
								.addContainerGap()
								.addComponent(jLayeredPane1,
										javax.swing.GroupLayout.PREFERRED_SIZE,
										327,
										javax.swing.GroupLayout.PREFERRED_SIZE)
								.addPreferredGap(
										javax.swing.LayoutStyle.ComponentPlacement.RELATED,
										javax.swing.GroupLayout.DEFAULT_SIZE,
										Short.MAX_VALUE).addComponent(jButton1)
								.addGap(28, 28, 28)));

		pack();
	}// </editor-fold>
	//GEN-END:initComponents

	private void jLabel2MouseClicked(java.awt.event.MouseEvent evt) {
		System.out.println(" jLabel2MouseClicked ");
	}

	private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
		// TODO add your handling code here:
	}

	/**
	 * @param args the command line arguments
	 */
	public static void main(String args[]) {
		java.awt.EventQueue.invokeLater(new Runnable() {
			public void run() {
				new frmWin().setVisible(true);
			}
		});
	}

	//GEN-BEGIN:variables
	// Variables declaration - do not modify
	private javax.swing.JButton jButton1;
	private javax.swing.JButton jButton2;
	private javax.swing.JLabel jLabel1;
	private javax.swing.JLabel jLabel2;
	private javax.swing.JLayeredPane jLayeredPane1;
	// End of variables declaration//GEN-END:variables

}